<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::get('api/index/test', 'api/Index/test')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //上传图片
Route::get('api/index/index', 'api/Index/index')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //上传图片
Route::get('api/index/index2', 'api/Index/index2')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //上传图片

Route::post('api/upload/image', 'api/Upload/image')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //上传图片
Route::get('api/system/config', 'api/Index/getSystemConfig')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //获取系统配置

Route::get('api/service/cates', 'api/service/getServiceCategory')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //服务的类别
Route::get('api/service/list', 'api/service/getServicesList')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //指定类别的服务(不分页)
Route::get('api/service/pagelist', 'api/service/getServicesPageList')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //服务分页列表
Route::get('api/service/info', 'api/service/getInfo')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //服务详情
Route::get('api/service/ordertime', 'api/service/getServiceOrderTime')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //查询可预约的时间

//用户相关
Route::post('api/oauth/login', 'api/Oauth/login')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //用户登录
Route::post('api/oauth/register', 'api/Oauth/register')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //用户注册
Route::post('api/oauth/get_mobile', 'api/Oauth/getPhoneNumber')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //获取用户微信绑定的手机号码
Route::post('api/oauth/get_openid', 'api/Oauth/getOpenid')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //获取用户微信绑定的手机号码
Route::get('api/user/info', 'api/User/info')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //获取用户信息
Route::get('api/user/master_info', 'api/User/master_info')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //获取用户师傅入驻信息
Route::post('api/user/setting', 'api/User/setting')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //设置用户信息

Route::get('api/score/pagelist', 'api/UserScore/index')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //积分记录

Route::get('api/collection/list', 'api/UserServiceCollection/index')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //服务收藏列表
Route::post('api/collection/add', 'api/UserServiceCollection/add')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //添加服务收藏
Route::post('api/collection/cancel', 'api/UserServiceCollection/cancel')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //取消服务收藏

Route::get('api/bank/list', 'api/UserBank/index')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //银行卡列表
Route::get('api/bank/info', 'api/UserBank/info')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //银行卡信息
Route::post('api/bank/set_default', 'api/UserBank/setDefault')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //设置默认
Route::post('api/bank/add', 'api/UserBank/add')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //添加银行卡
Route::post('api/bank/edit', 'api/UserBank/edit')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //修改银行卡
Route::post('api/bank/del', 'api/UserBank/del')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //删除银行卡

Route::get('api/address/list', 'api/UserAddress/index')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //地址列表
Route::get('api/address/info', 'api/UserAddress/info')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //地址信息
Route::post('api/address/set_default', 'api/UserAddress/setDefault')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //设置默认
Route::post('api/address/add', 'api/UserAddress/add')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //添加地址
Route::post('api/address/edit', 'api/UserAddress/edit')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //修改地址
Route::post('api/address/del', 'api/UserAddress/del')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //删除地址

//师傅入驻
Route::get('api/master/info', 'api/UserMaster/info')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //入驻申请信息
Route::post('api/master/add', 'api/UserMaster/add')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //添加入驻
Route::post('api/master/edit', 'api/UserMaster/edit')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //修改入驻

//推广入驻
Route::get('api/promoter/info', 'api/UserPromoter/info')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //入驻申请信息
Route::post('api/promoter/add', 'api/UserPromoter/add')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //添加入驻
Route::post('api/promoter/edit', 'api/UserPromoter/edit')->header('Access-Control-Allow-Headers', 'token,auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With')->allowCrossDomain(); //修改入驻

Route::post('wechat/notify/service_order_create', 'wechat/pay/notify_service_order_create');
Route::post('wechat/notify/service_order_refund', 'wechat/pay/notify_service_order_refund');
